package com.example.hao.animation_demo;

import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class View3Activity extends AppCompatActivity {

    private ImageView iv_top;
    private View rocket;
    private ImageView next;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view3);
        initView();
    }

    private void initView() {
        iv_top = findViewById(R.id.top);
        rocket = findViewById(R.id.rocket);
        next = findViewById(R.id.next);
        System.out.println(rocket);
        MyAnimationUtils.method(this, R.anim.anim_scale, iv_top);
        MyAnimationUtils.method(this, R.anim.anim_translate, next);
        AnimationDrawable drawable = (AnimationDrawable) rocket.getBackground();
        drawable.start();


    }
}